package com.attendancesystem.model;

import java.math.BigDecimal;

public class Grade {
    private Integer gradeId;
    private String studentId;
    private String courseName;
    private BigDecimal usualScore;
    private BigDecimal finalScore;
    private BigDecimal totalScore;
    private String StudentName;

    public String getStudentName() {
        return StudentName;
    }

    public void setStudentName(String studentName) {
        StudentName = studentName;
    }

    // 无参构造函数
    public Grade() {
    }

    // 全参构造函数（不含自动生成的totalScore）
    public Grade(Integer gradeId, String studentId, String courseName,
                 BigDecimal usualScore, BigDecimal finalScore) {
        this.gradeId = gradeId;
        this.studentId = studentId;
        this.courseName = courseName;
        this.usualScore = usualScore;
        this.finalScore = finalScore;
    }

    // Getters and Setters
    public Integer getGradeId() {
        return gradeId;
    }

    public void setGradeId(Integer gradeId) {
        this.gradeId = gradeId;
    }

    public String getStudentId() {
        return studentId;
    }

    public void setStudentId(String studentId) {
        this.studentId = studentId;
    }

    public String getCourseName() {
        return courseName;
    }

    public void setCourseName(String courseName) {
        this.courseName = courseName;
    }

    public BigDecimal getUsualScore() {
        return usualScore;
    }

    public void setUsualScore(BigDecimal usualScore) {
        this.usualScore = usualScore;
    }

    public BigDecimal getFinalScore() {
        return finalScore;
    }

    public void setFinalScore(BigDecimal finalScore) {
        this.finalScore = finalScore;
    }

    // 只读属性（根据数据库生成规则）
    public BigDecimal getTotalScore() {
        return totalScore;
    }

    // 仅供ORM框架设置值
    public void setTotalScore(BigDecimal totalScore) {
        this.totalScore = totalScore;
    }

    @Override
    public String toString() {
        return "Grade{" +
                "gradeId=" + gradeId +
                ", studentId='" + studentId + '\'' +
                ", courseName='" + courseName + '\'' +
                ", usualScore=" + usualScore +
                ", finalScore=" + finalScore +
                ", totalScore=" + totalScore +
                '}';
    }
}

